home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWResour / Include / SLResFil.idl < prev    next >
Encoding:
Text File  |  1996-08-16  |  3.6 KB  |  134 lines  |  [TEXT/MPS ]

  1. //
  2. //
  3. //    File:                SLResFil.idl
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //
  9.  
  10. #ifndef SLRESFIL_IDL
  11. #define SLRESFIL_IDL
  12.  
  13. #ifndef SLRESFIL_IDL
  14. #include "SLStdDef.idl"
  15. #endif
  16.  
  17. #ifndef SLREFCNT_IDL
  18. #include "SLRefCnt.idl"
  19. #endif
  20.  
  21. #ifndef SLRESOUR_IDL
  22. #include "SLResour.idl"
  23. #endif
  24.  
  25.  
  26. // interface shutUpAboutTheCommentAlready;
  27.  
  28.  
  29. //==============================================================================
  30. // Classes defined in this interface
  31. //==============================================================================
  32.  
  33. interface  FW_OResourceFile;
  34.  
  35.  
  36. //==============================================================================
  37. // Types used by this interface
  38. //==============================================================================
  39.  
  40. interface  FW_OFileSpecification;
  41.  
  42.  
  43. //========================================================================================
  44. // CLASS FW_OResourceFile
  45. //    This class is the reference counted representation class used by the
  46. //    FW_PResourceFile class.
  47. //========================================================================================
  48.  
  49. interface FW_OResourceFile : FW_ORefCount
  50. {
  51.     void InitFromFileSpec(in FW_OFileSpecification newFileSpec);
  52.         // Open a resources file by name.
  53.         // This instance assumes responsibility for closing the file.
  54.  
  55.     void InitFromResFileID(in FW_ResourceFileID resFileID);
  56.         // Attach to a previously opened file.
  57.         // This instance does not assume responsibility for closing the file.
  58.  
  59.     FW_OFileSpecification GetFileSpecification();
  60.         // Get the file specification for the resourcesFile.
  61.     
  62.     FW_Boolean HasResource(in FW_ResourceId resourceId,
  63.                            in FW_ResourceType resourceType);
  64.         // Returns TRUE if the resource exists in the file, FALSE if it doesn't.
  65.  
  66.     FW_ResourceHandle GetResourceHandle(in FW_ResourceId resourceId,
  67.                                         in FW_ResourceType resourceType);
  68.         // Gets the resource handle.  Resource data may still be purgeable or unloaded.
  69.         // Client assumes responsibility to call ReleaseResourceHandle when done.
  70.  
  71.     void ReleaseResourceHandle(in FW_ResourceHandle handle);
  72.         // Releases the resource handle.  All memory is released.
  73.  
  74.     FW_Boolean PrivHasSpecialResource(in FW_ResourceId resourceId,
  75.                                          in FW_ResourceType resourceType);
  76.         // Returns TRUE if the resource exists in the file, FALSE if it doesn't.
  77.     
  78.     FW_PlatformHandle PrivGetSpecialResource(in FW_ResourceId resourceId,
  79.                                                 in FW_ResourceType resourceType);
  80.         // Gets the special resource handle.
  81.         // It is the clients reponsibility to release the handle if necessary,
  82.         // using whatever platform specific code is required.
  83.  
  84.     FW_ResourceFileID    PrivGetResourceFileID();
  85.         // Return the platforms's "file ID" for this resources file.
  86.     
  87. #ifdef __SOMIDL__
  88. implementation
  89.     {
  90.         functionprefix = FW_OResourceFile__;
  91.         
  92.         override:
  93.             somInit,
  94.             somUninit;
  95.             
  96.         releaseorder:
  97.             somInit,
  98.             somUninit,
  99.  
  100.             InitFromFileSpec,
  101.             InitFromResFileID,
  102.             GetFileSpecification,
  103.             HasResource,
  104.             GetResourceHandle,
  105.             ReleaseResourceHandle,
  106.             PrivHasSpecialResource,
  107.             PrivGetSpecialResource,
  108.             PrivGetResourceFileID;
  109.  
  110.         majorversion = 1;
  111.         minorversion = 0;
  112.  
  113.         passthru C_xh =
  114.             "#include \"SLResour.xh\"";
  115.  
  116.         passthru C_xih =
  117.             "";
  118.  
  119. #ifdef __PRIVATE__
  120.     FW_Boolean                fMustCloseFile;
  121.         // TRUE if this instance has assumed responsibility for closing the file.
  122.  
  123.     FW_ResourceFileID         fResourceFileID;
  124.         // The platform's file ID for the resources file.
  125.  
  126.     FW_OFileSpecification    fFileSpec;
  127.         // The file specification for the resources file.
  128. #endif
  129.   };
  130. #endif //# __SOMIDL__
  131. };
  132.  
  133. #endif
  134.